﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="General.ascx.cs" Inherits="Controls_Page_General" %>
<%@ Register TagPrefix="TreeView" TagName="all" Src="treeview.ascx" %>
<%@ Register Assembly="RJS.Web.WebControl.PopCalendar.Net.2010" Namespace="RJS.Web.WebControl"
    TagPrefix="rjs" %>
<style type="text/css">
    .redTitle
    {
        color: Red;
        font-weight: bold;
    }
    .cursor
    {
        cursor: pointer;
    }
    .stylePopup
    {
        background-color: #fff;
        z-index: 10001; /*width: 800px;
            height: 390px;*/
        
        height: 300px;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
    }
    .stylePopup1
    {
        background-color: #fff;
        z-index: 10001; /*width: 800px;
            height: 390px;*/
        width: 200px;
        height: 100px;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
    }
    .stylePopup2
    {
        background-color: #fff;
        z-index: 10001; /*width: 800px;
            height: 390px;*/
        width: 400px;
        height: 100px;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
    }
    .modalBackground
    {
        height: 100%;
        left: 0;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: 10000;
        background-color: black;
        opacity: 0.3;
        filter: alpha(opacity=100);
    }
    .modalBackground1
    {
        background-color: Black;
        filter: alpha(opacity=90);
        opacity: 0.8;
    }
    .modalPopup
    {
        background-color: #FFFFFF;
        border-width: 3px;
        border-style: solid;
        border-color: black;
        padding-top: 10px;
        padding-left: 10px;
        width: 300px;
        height: 140px;
    }
    .stylePopup4
    {
        background-color: #fff;
        z-index: 10001; /*width: 800px;
            height: 390px;*/
        width: 600px;
        height: 100px;
        position: absolute;
        top: 0;
        bottom: 300px;
        left: 0;
        right: 0;
        margin: auto;
    }
</style>
<script type="text/javascript" src="../../Scripts/jquery-1.3.2.min.js"></script>
<%--<script type="text/javascript" src="../../Scripts/jquery.js"></script>
<script type="text/javascript" src="../../Scripts/jquery.MultiFile.pack.js"></script>--%>
<script type="text/javascript">
    function ThemBaiViet() {
        alert("abc");
        document.getElementById('<%#popupThemBaiViet.ClientID %>').style.display = "block";
    }
    function SearchMau() {
        var keySearch = document.getElementById('<%=tbKeySearch.ClientID %>').value;
        if (keySearch == "" || keySearch == null) {
            alert("Không để trống từ khóa tìm kiếm !!!");
        }
    }
    function ConfirmDeleteMau() {
        var check = confirm("Bạn có chắc muốn xóa không ?");
        if (check == true) {
            document.getElementById('<%=hdnCheckConfirm.ClientID %>').value = "yes";
        } else {

        }
    }
    function SearchDate() {
        var valueFrom = document.getElementById('<%=txtFrom.ClientID %>').value;
        var valueTo = document.getElementById('<%=txtTo.ClientID %>').value;
        if (valueFrom == "" || valueTo == "") {
            alert("Chọn ngày tháng trước khi search !!!");
        }
    }
    function DeleteFile(nameFile) {
        document.getElementById('<%=hdnFileName.ClientID %>').value = nameFile;
        $get('<%=btnDeleteFile.ClientID %>').click();
    }
    function LogoutFunction() {
        $get('<%=btnLogout.ClientID%>').click();
    }
    function GoPageAdmin() {
        $get('<%=btnGoPageAdmin.ClientID%>').click();
    }
</script>
<script type="text/javascript">
    $(document).ready(function () {
        document.getElementById('<%=ddlTypeSearch.ClientID %>').onchange = function () {
            var sheet = document.getElementById('<%=ddlTypeSearch.ClientID %>').value;
            if (sheet == "4") {
                document.getElementById('<%=divSearchDate.ClientID%>').style.display = 'block';
                document.getElementById('<%=tbKeySearch.ClientID%>').style.display = 'none';
                document.getElementById('<%=btnSearch.ClientID%>').style.display = 'none';
            } else {
                document.getElementById('<%=divSearchDate.ClientID %>').style.display = 'none';
                document.getElementById('<%=tbKeySearch.ClientID%>').style.display = 'inline-block';
                document.getElementById('<%=btnSearch.ClientID%>').style.display = 'inline-block';
                $("#<%=ddlTypeSearch.ClientID%>").val(sheet).change();
            }
        };


        $("#<%=txtFrom.ClientID %>").dynDateTime({
            showsTime: true,
            ifFormat: "%Y/%m/%d %H:%M",
            daFormat: "%l;%M %p, %e %m,  %Y",
            align: "BR",
            electric: false,
            singleClick: false,
            displayArea: ".siblings('.dtcDisplayArea')",
            button: ".next()"
        });


        $("#<%=txtTo.ClientID %>").dynDateTime({
            showsTime: true,
            ifFormat: "%Y/%m/%d %H:%M",
            daFormat: "%l;%M %p, %e %m,  %Y",
            align: "BR",
            electric: false,
            singleClick: false,
            displayArea: ".siblings('.dtcDisplayArea')",
            button: ".next()"
        });

    });
</script>
<div id="maincontent">
    <div style="border-right: 1px">
        <div id="treeView" style="width: 25%; height: 100%; margin-top: 30px">
            <%--<asp:TextBox ID="tbVirusSearch" runat="server" Width="80" Style="padding-left: 2px;
                margin-left: 100px; margin-top: 10px"></asp:TextBox>
            <asp:ImageButton ID="ibSearchVirus" runat="server" Style="width: 25px; position: relative;
                top: 6px" ImageUrl="~/Images/search_button.png" OnClick="searchVirus" />--%>
            <div>
                <asp:TreeView ID="treeView1" runat="server" Font-Size="Medium" OnSelectedNodeChanged="treeView1_SelectedNodeChanged"
                    Style="margin-top: 5px">
                </asp:TreeView>
            </div>
        </div>
        <div id="rightContent" style="width: 75%; height: 100%; border-left: 1px">
            <div>
                <div id="left" style="width: 100%; float: left; border-left: soid #ccc">
                    <div id="divImage" style="margin-left: 20px">
                        <img width="141" height="39" style="margin-top: 10px" alt="nothing" src="Images/image002.png" />
                        <h4 style="float: right">
                            Welcome,
                            <asp:Label runat="server" ID="lbNameMember" Style="color: Red"></asp:Label>
                            <a class="cursor" style="color: Blue" onclick="LogoutFunction()">[Logout]</a><br />
                            <a class="cursor" id="adminPage" runat="server" style="display: none" onclick="GoPageAdmin()"><font color="blue">Admin Page</font></a>
                        </h4>
                    </div>
                    <br />
                    <div id="divGeneralSearch" style="top: 70px; z-index: 1; position: absolute; margin-left: 20px">
                        <asp:DropDownList ID="ddlTypeSearch" runat="server" EnableViewState="true">
                            <asp:ListItem Value="0">Tên mẫu</asp:ListItem>
                            <asp:ListItem Value="1">Loại Mẫu</asp:ListItem>
                            <asp:ListItem Value="2">Tên Hàm Diệt</asp:ListItem>
                            <asp:ListItem Value="3">Người Phân Tích</asp:ListItem>
                            <asp:ListItem Value="4">Ngày Tháng</asp:ListItem>
                            <asp:ListItem Value="5">Sự Vụ</asp:ListItem>
                            <asp:ListItem Value="6">Loại Malware</asp:ListItem>
                            <asp:ListItem Value="7">Hành Vi</asp:ListItem>
                            <asp:ListItem Value="8">Kĩ Thuật Anti</asp:ListItem>
                            <asp:ListItem Value="9">Domain Server Connect</asp:ListItem>
                        </asp:DropDownList>
                        <asp:TextBox ID="tbKeySearch" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" class="button" OnClientClick="SearchMau()"
                            OnClick="btnSearch_Click" />
                        <asp:Button ID="btnSearchCustom" runat="server" class="button" Text="Tìm kiếm nội dung"
                            OnClick="btnSearchCustom_Click" />
                    </div>
                    <br />
                    <br />
                    <div id="divSearchDate" runat="server" style="display: none; margin-left: 20px">
                        <asp:Label ID="lbFrom" Text="Từ" runat="server"></asp:Label>
                        <asp:TextBox ID="txtFrom" runat="server" ReadOnly="true"></asp:TextBox>
                        <rjs:PopCalendar ID="PopCalendar2" runat="server" Control="txtFrom" Visible="true"
                            Culture="en-EN" Format="yyyy-mm-dd" />
                        <asp:Label ID="lbTo" Text="Đến: " runat="server"></asp:Label>
                        <asp:TextBox ID="txtTo" runat="server" ReadOnly="true"></asp:TextBox>
                        <rjs:PopCalendar ID="PopCalendar3" runat="server" Control="txtTo" Visible="true"
                            Culture="en-EN" Format="yyyy-mm-dd" />
                        <asp:Button Text="Tìm kiếm" ID="btnSearchDate" class="button" runat="server" OnClientClick="SearchDate()"
                            OnClick="btnSearchDate_Click" Style="margin-left: 5px"></asp:Button>
                    </div>
                </div>
                <%--<div id="right" style="width: 40%; float: left">
                <asp:TreeView ID="treeViewDetail" runat="server"></asp:TreeView>
            </div>--%>
            </div>
            <div id="line" style="position: relative; height: 2px; background-color: #BEBEBE;
                margin-top: 150px">
            </div>
            <div id="location" style="position: absolute; margin-top: 10px; margin-left: 20px;
                font-weight: bold; font-size: 15px">
                <table border="0">
                    <tr>
                        <th style="width: 45%">
                            <asp:Label ID="lbWorkPlace" runat="server" Style="float: left"></asp:Label>
                        </th>
                        <th style="width: 5%">
                            <asp:Button Text="Thêm Mẫu Mới" ID="btnThemMau" runat="server" class="button" OnClick="btnThemMau_Click"
                                Style="position: relative; margin-left: 100px; display: none" />
                        </th>
                        <th style="width: 50%">
                            <asp:Button Text="Thêm Bài Viết" ID="btnThemBaiViet" class="button" runat="server"
                                OnClick="btnThemBaiViet_Click" Style="position: relative; display: none" />
                            <asp:Button Text="Sửa Mẫu" ID="btnSuaMau" class="button" runat="server" OnClick="btnSuaMau_Click"
                                Style="position: relative; display: none" />
                            <asp:Button Text="Xóa Mẫu" ID="btnXoaMau" class="button" runat="server" OnClientClick="ConfirmDeleteMau()"
                                OnClick="btnXoaMau_Click" Style="position: relative; display: none" />
                            <asp:Button Text="Upload Data" ID="btnPopupUpload" class="button" Style="display: none"
                                runat="server" OnClick="UploadData_Click" />
                        </th>
                    </tr>
                </table>
            </div>
            <div id="Div1" style="position: relative; height: 2px; background-color: #BEBEBE;
                margin-top: 55px">
            </div>
            <div id="divBaiVietContent" style="margin-top: 20px">
                <asp:PlaceHolder runat="server" ID="placeHolder2"></asp:PlaceHolder>
                <asp:PlaceHolder runat="server" ID="placeHolder3"></asp:PlaceHolder>
            </div>
        </div>
    </div>
    <div id="divHiddenField" style="display: none">
        <asp:HiddenField ID="hdnCheckConfirm" runat="server" />
        <asp:HiddenField ID="hdnFileName" runat="server" />
        <asp:Button ID="btnDeleteFile" runat="server" OnClick="DeleteFile" />
        <asp:Button ID="btnLogout" runat="server" OnClick="btnLogout_Click" />
        <asp:Button ID="btnGoPageAdmin" runat="server" OnClick="btnGoPageAdmin_Click" />
    </div>
    <div id="divPopup">
        <div id="popupThemBaiViet" style="display: none" runat="server">
            <div class="stylePopup1">
                <asp:Panel ID="panel1" runat="server" Width="250px" BackColor="#C0C0C0">
                    <div style="background-color: #FFFFFF">
                        <div style="background-color: #4B6C9E; font-weight: bolder; font-size: medium; text-align: center;"
                            align="center">
                            <asp:Label ID="Label1" Style="color: White" runat="server">Thêm Bài Viết</asp:Label>
                        </div>
                        <table>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <asp:Label ID="lbTenVirus" runat="server" Style="color: Red; margin-left: 50px; font-weight: bold"></asp:Label>
                                </td>
                            </tr>
                            <asp:CheckBoxList ID="cblBaiViet" runat="server">
                            </asp:CheckBoxList>
                        </table>
                        <div align="center" style="text-align: justify">
                            <asp:Button ID="btnOKThemBaiViet" runat="server" class="button" Style="text-align: center;
                                margin-left: 25px; margin-bottom: 10px" Text="OK" Width="80px" BackColor="#4B6C9E"
                                OnClick="btnOKThemBaiViet_Click" />
                            <asp:Button ID="btnCancelThemBaiViet" runat="server" class="button" Style="text-align: center;
                                margin-left: 20px; margin-bottom: 10px" Text="Cancel" Width="80px" BackColor="#4B6C9E"
                                OnClick="btnCancelThemBaiViet_Click" />
                        </div>
                    </div>
                </asp:Panel>
            </div>
            <div class="modalBackground">
            </div>
        </div>
        <div id="popupAddEditMau" runat="server" style="display: none">
            <div class="stylePopup4">
                <asp:Panel ID="panel2" runat="server" BackColor="#C0C0C0">
                    <div style="background-color: #FFFFFF">
                        <div style="background-color: #4B6C9E; font-weight: bolder; font-size: medium; text-align: center;"
                            align="center">
                            <asp:Label ID="Label2" Style="color: White" runat="server"></asp:Label>
                        </div>
                        <br />
                        <table>
                            <tr>
                                <td style="text-align: right">
                                    <asp:Label ID="lblError" runat="server" Style="display: none"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lbTenMau" runat="server" Style="margin-left: 5px" Text="Tên Mẫu"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="tbTenMau" runat="server" Style="margin-left: 15px" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label3" Style="margin-left: 5px" runat="server" Text="Loại Mẫu"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList1" runat="server" Style="margin-left: 15px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lbTenHamDiet" Style="margin-left: 5px" runat="server" Text="Tên hàm diệt"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="tbTenHamDiet" runat="server" Width="300px" Style="margin-left: 15px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr id="trNguoiPhanTich" runat="server">
                                <td>
                                    <asp:Label ID="Label5" Style="margin-left: 5px" runat="server" Text="Người phân tích"> </asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList2" runat="server" Style="margin-left: 15px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lbNgayThang" Style="margin-left: 5px" runat="server" Text="Ngày tháng"> </asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="tbNgayThang" runat="server" Width="200px" Style="margin-left: 15px"></asp:TextBox>
                                    <rjs:PopCalendar ID="PopCalendar1" runat="server" Control="tbNgayThang" Visible="true"
                                        Culture="en-EN" Format="yyyy-mm-dd" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lbSuVu" Style="margin-left: 5px" runat="server" Text="Sự vụ"> </asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="tbSuVu" runat="server" Width="300px" Style="margin-left: 15px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label8" Style="margin-left: 5px" runat="server" Text="Loại malware"> </asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList3" runat="server" Style="margin-left: 15px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label9" Style="margin-left: 5px" runat="server" Text="Hành vi"> </asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList4" runat="server" Style="margin-left: 15px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label10" Style="margin-left: 5px" runat="server" Text="Kĩ thuật Anti"> </asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList5" runat="server" Style="margin-left: 15px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lbDomain" Style="margin-left: 5px" runat="server" Text="DomainServerConect"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="tbDomain" runat="server" Width="300px" Style="margin-left: 15px"></asp:TextBox><br />
                                </td>
                            </tr>
                        </table>
                        <div style="margin-left: 160px">
                            <asp:Button ID="btnOKAddMau" runat="server" class="button" Style="margin-bottom: 10px;
                                display: none" Text="OK" Width="80px" OnClick="btnOKAddMau_Click" BackColor="#4B6C9E" />
                            <asp:Button ID="btnOKEditMau" runat="server" class="button" Style="margin-bottom: 10px;
                                display: none" Text="OK" Width="80px" OnClick="btnOKEditMau_Click" BackColor="#4B6C9E" />
                            <asp:Button ID="btnCancelAddEditMau" runat="server" class="button" Style="text-align: center;
                                margin-left: 100px; margin-bottom: 10px" Text="Cancel" Width="80px" BackColor="#4B6C9E"
                                OnClick="btnCancelAddEditMau_Click" />
                        </div>
                    </div>
                </asp:Panel>
            </div>
            <div class="modalBackground">
            </div>
        </div>
        <div id="Div2" style="display: none" runat="server">
            <div class="stylePopup2">
                <asp:Panel ID="panel3" runat="server" Width="400px" BackColor="#C0C0C0">
                    <div style="background-color: #FFFFFF">
                        <div style="background-color: #4B6C9E; font-weight: bolder; font-size: medium; text-align: center;"
                            align="center">
                            <asp:Label ID="Label6" Style="color: White" runat="server">Upload</asp:Label>
                            <asp:ImageButton ID="ImageClose" runat="server" src="Images/close.png" Width="4%"
                                Style="float: right" OnClick="ImageClose_Click" />
                        </div>
                        <div align="center" style="text-align: center; margin-top: 20px">
                            <asp:FileUpload ID="fileUpload1" runat="server" />
                            <asp:Button ID="Button1" runat="server" Text="Upload" OnClick="btnUpload_Click" />
                            <asp:Label ID="lblMessage" runat="server"></asp:Label>
                        </div>
                        <div id="divManagerFile" style="margin-left: 30px">
                            <asp:Repeater ID="rptFileManager" runat="server">
                                <ItemTemplate>
                                    <asp:Label ID="labelFile" runat="server" Text='<%# Eval("Name") %>'>
                                    </asp:Label>
                                    <a href="#" onclick="DeleteFile('<%#Eval("Name") %>')" style="float: right; margin-right: 45px">
                                        <asp:Label ID="lbDeleteFile" runat="server" Text="Delete" ToolTip='<%#Eval("Name") %>'></asp:Label></a><br />
                                </ItemTemplate>
                            </asp:Repeater>
                        </div>
                    </div>
                </asp:Panel>
            </div>
            <div class="modalBackground">
            </div>
        </div>
    </div>
</div>
